package com.wondertek.poms.dao.po;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;

import com.fasterxml.jackson.annotation.JsonInclude;

import lombok.Data;

@Data
@Entity
@Table(name = "MEDIA_FILE")
@DynamicUpdate
@DynamicInsert
@Proxy(lazy = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MediaFile implements Serializable {

    private static final long serialVersionUID = 1269299399467361833L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MEDIA_FILE_SEQ")
    @SequenceGenerator(name = "MEDIA_FILE_SEQ", allocationSize = 1, sequenceName = "MEDIA_FILE_SEQ")
    private Long id;

    @Column(name = "MEDIA_FILE_ID")
    private String mediaFileID;

    @Column(name = "CONTENT_ID")
    private String contentId;

    @Column(name = "MEDIA_FILE_NAME")
    private String mediaFileName;

    @Column(name = "SOURCE_FILE_NAME")
    private String sourceFileName;

    @Column(name = "VISIT_PATH")
    private String visitPath;

    @Column(name = "MEDIA_FILE_PATH")
    private String mediaFilePath;

    @Column(name = "MEDIA_FILE_PREVIEW_PATH")
    private String mediaFilePreviewPath;

    @Column(name = "MEDIA_FILE_ACTION")
    private String mediaFileAction;//0-新增文件,1-修改文件,2-删除文件,3-文件不变

    @Column(name = "MEDIA_SIZE")
    private String mediaSize;

    @Column(name = "DURATION")
    private String duration;

    @Column(name = "MEDIA_TYPE")
    private String mediaType;

    @Column(name = "MEDIA_USAGE_CODE")
    private String mediaUsageCode;

    @Column(name = "MEDIA_CODE_FORMAT")
    private String mediaCodeFormat;

    @Column(name = "MEDIA_CONTAIN_FORMAT")
    private String mediaContainFormat;

    @Column(name = "MEDIA_CODE_RATE")
    private String mediaCodeRate;

    @Column(name = "MEDIA_NET_TYPE")
    private String mediaNetType;

    @Column(name = "MEDIA_MIME_TYPE")
    private String mediaMimeType;

    @Column(name = "MEDIA_RESOLUTION")
    private String mediaResolution;

    @Column(name = "MEDIA_PROFILE")
    private String mediaProfile;

    @Column(name = "MEDIA_LEVEL")
    private String mediaLevel;

    @Column(name = "CDN_STATUS")
    private String cdnStatus;  //cdn注入状态  1表示成功 2表示失败

    @Column(name = "OPR_CODE")
    private String oprCode; //是否删除 0:新增，2:删除

    @Column(name = "DAMS_STATUS")
    private String damsStatus; //是否分发到dams 0:未分发，1:分发

    @Column(name = "GSLB_STATUS")
    private String gslbStatus;//是否已gslb注入 0:未注入,1:已注入

    @Transient
    private Boolean isHWVideoPlayURL;

    @Transient
    private Long width;

    @Transient
    private Long height;

    @Column(name = "MEDIA_STATUS")
    private String mediaStaus;//码率状态 0：可用 1：不可用

    @Column(name = "CDI_ID")
    private String cdiId;//码率状态 0：可用 1：不可用

    public MediaFile(){
        this.oprCode="0";
        this.damsStatus="0";
        this.gslbStatus="0";
    }


}
